#include <iostream>
#include <ctime>
using namespace std;
const int maxsize=100;
int a[maxsize];
int n;
void print()
{
    for (int i = 0; i < n; ++i) {
           cout<<a[i]<<" ";
    }
       cout<<endl;
}
void Reverse(int left,int right)
{
    for(int i=left,j=right;i<=j;i++,j--)
    {
        swap(a[i],a[j]);
    }
}
void ArrayLeftMove(int k)
{
    //三次Reverse就可以实现左旋转
    Reverse(n-k,n-1);  //n-1-?=k-1
    Reverse(0,n-k-1);
    Reverse(0,n-1);

}
int main() {
    cin>>n;
    srand(time(0));
    for (int i = 0; i <n ; ++i) {
        a[i]=rand()%(100)+1;
    }


    print();
    ArrayLeftMove(3);
    //数组循环右移
    print();

    //数组循环左移


    return 0;
}
